/*********************************
File: myQueue.h
队列元素类型在include之前可以重新定义:
#define QTYPE
typedef char TDSTYPE;
#include "myQueue.h"
*********************************/

#ifndef MY_QUEUE
#define MY_QUEUE

#ifndef QTYPE
#define QTYPE
typedef int TDQTYPE;
#endif

typedef struct {
    TDQTYPE *queue;
    int size;
    int tail;
    int head;
    int count;
} MyQueue;

/** Initialize your data structure here. */
MyQueue* myQueueCreate(int maxSize);

/** Push element x to the back of queue. */
void myQueuePush(MyQueue* obj, TDQTYPE x);

/** Removes the element from in front of queue and returns that element. */
TDQTYPE myQueuePop(MyQueue* obj);

/** Get the front element. */
TDQTYPE myQueuePeek(MyQueue* obj);

/** Returns whether the queue is empty. */
int myQueueEmpty(MyQueue* obj);

void myQueueFree(MyQueue* obj);

#endif
